package org.hfy.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 合同状态枚举
 */
@Getter
@AllArgsConstructor
public enum ContractStatus {
    PENDING_AUDIT("待审核", "待审核"),
    AUDIT_PASSED("审核通过", "审核通过"),
    AUDIT_REJECTED("审核拒绝", "审核拒绝");

    private final String code;
    private final String description;

    public static ContractStatus fromCode(String code) {
        for (ContractStatus status : values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return PENDING_AUDIT; // 默认返回待审核状态
    }
} 